package com.qingcheng.dao;

import com.qingcheng.pojo.system.Resource;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Map;

public interface ResourceMapper extends Mapper<Resource> {
    @Select("SELECT * FROM tb_role r\n" +
            "INNER JOIN tb_role_resource rr\n" +
            "ON r.id=rr.role_id\n" +
            "INNER JOIN tb_resource rs\n" +
            "ON rr.`resource_id`=rs.id\n" +
            "WHERE r.id=#{id}")
    List<Map> findByidResource(@Param("id") Integer id);

}
